Optimal. Leaf size=56 \[ -\frac {b^2 \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{a^{5/2} \sqrt {a+b}}+\frac {(a-b) \tan (x)}{a^2}+\frac {\tan ^3(x)}{3 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3187, 461, 205} \[ -\frac {b^2 \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{a^{5/2} \sqrt {a+b}}+\frac {(a-b) \tan (x)}{a^2}+\frac {\tan ^3(x)}{3 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 205
Rule 461
Rule 3187
Rubi steps
\begin {align*} \int \frac {\sec ^4(x)}{a+b \cos ^2(x)} \, dx &=-\operatorname {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^4 \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )\\ &=-\operatorname {Subst}\left (\int \left (\frac {1}{a x^4}+\frac {a-b}{a^2 x^2}+\frac {b^2}{a^2 \left (a+(a+b) x^2\right )}\right ) \, dx,x,\cot (x)\right )\\ &=\frac {(a-b) \tan (x)}{a^2}+\frac {\tan ^3(x)}{3 a}-\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{a^2}\\ &=-\frac {b^2 \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{a^{5/2} \sqrt {a+b}}+\frac {(a-b) \tan (x)}{a^2}+\frac {\tan ^3(x)}{3 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 55, normalized size = 0.98 \[ \frac {b^2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (x)}{\sqrt {a+b}}\right )}{a^{5/2} \sqrt {a+b}}+\frac {\tan (x) \left (a \sec ^2(x)+2 a-3 b\right )}{3 a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.95, size = 276, normalized size = 4.93 \[ \left [-\frac {3 \, \sqrt {-a^{2} - a b} b^{2} \cos \relax (x)^{3} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \relax (x)^{4} - 2 \, {\left (4 \, a^{2} + 3 \, a b\right )} \cos \relax (x)^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cos \relax (x)^{3} - a \cos \relax (x)\right )} \sqrt {-a^{2} - a b} \sin \relax (x) + a^{2}}{b^{2} \cos \relax (x)^{4} + 2 \, a b \cos \relax (x)^{2} + a^{2}}\right ) - 4 \, {\left (a^{3} + a^{2} b + {\left (2 \, a^{3} - a^{2} b - 3 \, a b^{2}\right )} \cos \relax (x)^{2}\right )} \sin \relax (x)}{12 \, {\left (a^{4} + a^{3} b\right )} \cos \relax (x)^{3}}, -\frac {3 \, \sqrt {a^{2} + a b} b^{2} \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \relax (x)^{2} - a}{2 \, \sqrt {a^{2} + a b} \cos \relax (x) \sin \relax (x)}\right ) \cos \relax (x)^{3} - 2 \, {\left (a^{3} + a^{2} b + {\left (2 \, a^{3} - a^{2} b - 3 \, a b^{2}\right )} \cos \relax (x)^{2}\right )} \sin \relax (x)}{6 \, {\left (a^{4} + a^{3} b\right )} \cos \relax (x)^{3}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.17, size = 71, normalized size = 1.27 \[ \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (a) + \arctan \left (\frac {a \tan \relax (x)}{\sqrt {a^{2} + a b}}\right )\right )} b^{2}}{\sqrt {a^{2} + a b} a^{2}} + \frac {a^{2} \tan \relax (x)^{3} + 3 \, a^{2} \tan \relax (x) - 3 \, a b \tan \relax (x)}{3 \, a^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.11, size = 51, normalized size = 0.91 \[ \frac {\tan ^{3}\relax (x )}{3 a}+\frac {\tan \relax (x )}{a}-\frac {\tan \relax (x ) b}{a^{2}}+\frac {b^{2} \arctan \left (\frac {a \tan \relax (x )}{\sqrt {\left (a +b \right ) a}}\right )}{a^{2} \sqrt {\left (a +b \right ) a}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.87, size = 48, normalized size = 0.86 \[ \frac {b^{2} \arctan \left (\frac {a \tan \relax (x)}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} a^{2}} + \frac {a \tan \relax (x)^{3} + 3 \, {\left (a - b\right )} \tan \relax (x)}{3 \, a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.31, size = 51, normalized size = 0.91 \[ \frac {{\mathrm {tan}\relax (x)}^3}{3\,a}-\mathrm {tan}\relax (x)\,\left (\frac {a+b}{a^2}-\frac {2}{a}\right )+\frac {b^2\,\mathrm {atan}\left (\frac {\sqrt {a}\,\mathrm {tan}\relax (x)}{\sqrt {a+b}}\right )}{a^{5/2}\,\sqrt {a+b}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{4}{\relax (x )}}{a + b \cos ^{2}{\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________